﻿@{
    var navAuthorization = Kendo.Mvc.Infrastructure.DI.Current.Resolve<Kendo.Mvc.Infrastructure.INavigationItemAuthorization>(); 
}
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>@ViewBag.Title</title>
        @Styles.Render("~/Content/css")
        @Styles.Render("~/Content/kendo-css")
    </head>
    <body>
        <div id="wrapper">
            <header id="header">
                <div id="logo">
                    <a href="@Url.Action("Content", "Home")"></a>
                </div>
                <div id="lang-nav">
                    @Html.Partial("_LoginPartial")

                    <a href="@Url.Action("ChangeCulture", "Home", new { lang = "bg", returnUrl = this.Request.RawUrl })" class="lang">
                        <img src="~/images/bul_flag.gif" alt="bg-image" />
                    </a>
                    <a href="@Url.Action("ChangeCulture", "Home", new { lang = "en", returnUrl = this.Request.RawUrl })" class="lang">
                        <img src="~/images/en_flag.gif" alt="en-image" />
                    </a>
                </div>
            </header>
            <div id="content">
                <div id="red-line"></div>
                @RenderSection("scripts", required: false)
                @Scripts.Render("~/Scripts/jquery")
                @Scripts.Render("~/Scripts/kendo-js")
                <div id="sub-content">
                    <nav id="nav">
                        <h1>@ViewResources.Content.Application:</h1>
                        <div id="accordion">

                            @Html.Kendo().Menu().Name("Menu").Orientation(MenuOrientation.Vertical).BindTo("sample", (item, siteMapNode) =>
                            {
                                var hasAccessible = true;
                                foreach (var children in siteMapNode.ChildNodes)
                                {
                                    hasAccessible = false;
                                    if (children.IsAccessible(navAuthorization, ViewContext))
                                    {
                                        hasAccessible = true;
                                        break;
                                    }
                                }
                                item.Visible = hasAccessible;
                            })

                        </div>
                    </nav>
                    <div id="right">
                        <div id="site-map">
                            @Html.MvcSiteMap().SiteMapPath()
                        </div>

                        @RenderBody()
                    </div>
                </div>
            </div>
            <footer id="footer">
                <div id="copyright">
                    @ViewResources.Layout.Copyrights
                </div>
                <div id="info">

                    @ViewResources.Layout.Info

                </div>
            </footer>
        </div>
    </body>
</html>